//
//  PersonalInfoCellCollectionViewCell.m
//  share_business
//
//  Created by baidufz on 2017/9/6.
//  Copyright © 2017年 wyl. All rights reserved.
//

#import "PersonalInfoCardCell.h"
#import "UIViewController+Util.h"
#import "PersonalInfoViewController.h"
#import "AdFeeDetailViewController.h"

@interface PersonalInfoCardCell ()

@property (weak, nonatomic) IBOutlet UIImageView *avatar;
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UIImageView *ivLevel;
@property (weak, nonatomic) IBOutlet UILabel *lateFee;
@property (weak, nonatomic) IBOutlet UILabel *adFee;
@property (strong, nonatomic) IBOutlet UILabel *shareValue;
@property (weak, nonatomic) IBOutlet UILabel *charmValue;
@property (weak, nonatomic) IBOutlet UILabel *bonusPont;

@end

@implementation PersonalInfoCardCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showIntegralDetail)];
    UITapGestureRecognizer *recognizer2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showIntegralDetail2)];
    UITapGestureRecognizer *recognizer3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showIntegralDetail3)];
    
    UITapGestureRecognizer *avatarRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showPersonalInfo)];
    
    _shareValue.userInteractionEnabled = YES;
    _charmValue.userInteractionEnabled = YES;
    _bonusPont.userInteractionEnabled = YES;
    _avatar.userInteractionEnabled = YES;

    [_shareValue addGestureRecognizer:recognizer];
    [_charmValue addGestureRecognizer:recognizer2];
    [_bonusPont addGestureRecognizer:recognizer3];
    [_avatar addGestureRecognizer:avatarRecognizer];
}


- (void)showIntegralDetail {
    [_delegate showIntegralDetail:IntegralDetailTypeShare];
}

- (void)showIntegralDetail2 {
    [_delegate showIntegralDetail:IntegralDetailTypeCharm];
}

- (void)showIntegralDetail3 {
    [_delegate showIntegralDetail:IntegralDetailTypeBonus];
}

- (void)showPersonalInfo {
//    [[UIViewController getCurrentVC] presentViewController:[[UINavigationController alloc] initWithRootViewController:[PersonalInfoViewController new]]animated:YES completion:nil];
    [[UIViewController getCurrentVC].navigationController pushViewController:[PersonalInfoViewController new] animated:YES];
}


- (IBAction)click:(id)sender {
//    [[UIViewController getCurrentVC] presentViewController:[[UINavigationController alloc] initWithRootViewController:[AdFeeDetailViewController new]]animated:YES completion:nil];
    [[UIViewController getCurrentVC].navigationController pushViewController:[AdFeeDetailViewController new] animated:YES];
}

@end
